<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSmsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('sms', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('mobile',32)->comment('手机号');
            $table->string('sms_code',32)->comment('短信验证码');
            $table->string('content')->comment('短信内容');
            $table->tinyInteger('used_for')->default(0)->comment('短信用途');
            $table->unsignedInteger('expired_at')->comment('过期时间');
            $table->boolean('has_used')->default(0)->comment('是否已使用');
            $table->timestamps();
        });

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('sms');
    }
}
